Alibabacloud.com offers a wide variety of articles about selenium test case example, easily find your selenium test case example information here online.
-JS = "document.getElementById" ("+ ID +"). Style.border=\ "3px solid" + color + "\" "; - - This. Execjs (JS); -}At this point, theWebUI automation function test script section 030-javascript in the Selenium Automation application example of five (highlighting elements) successfully completed, I hope this article can give beginners
) self.asserttrue (self.is_content_present ("%s"% Expected_ Value) def is_element_present (self, how, what): "" "Utility method to check presence of an Elem ENT on page:p arams how:by locator type:p arams what:locator value "" "Try:self . Browser.find_element (By=how, value=what) except Nosuchelementexception, _: Return False return T Rue def is_content_present (self, What): "" "Utility method to check presence of a element on page :p arams what:content value "" "Try:self.browser.find_ele
, "size", "ten"); // Call the RemoveAttribute method to delete the Size property value in the text box //removeattribute (driver,textinputbox, "size"); //Add page Element property properties and modify the wrapping method of page element properties }privatevoidsetattribute (Webdriver driver2,webelementtEXTINPUTBOX,NBSP;STRINGNBSP;STRING,NBSP;STRINGNBSP;STRING2) {//todo auto-generatedmethodstubjavascriptexecutorjs= ( Javascriptexecutor) driver;Objectelement=null; ObjectattributeName= "AA"; object
=driver.find_element_by_name (' NR ') #设置每页搜索结果为100条, first find id= Nr label, and then find the option tag under the Id=nr tabA Select button with value equal to 100 m.find_element_by_xpath ("//option[@value = ' 100 ' ]. Click () time.sleep (2) #保存设置的信息 driver.find_element_by_xpath ("//input[@ Value= ' Save Settings ']. Click () time.sleep (2) n=driver.switch_to_alert () n.accept () defteardown (self): Self.driver.quit () self.assertequal ([],self.verificationerrors) ' teardown The method
Address of the remote machine. Test result can be verified on the default TestNG report generatedSummary
Selenium Grid is used to run multiple tests simultaneously on different browsers and platforms.
Grid uses the Hub-node concept.
The hub is the central point wherein you load your tests.
Nodes is the Selenium instances that'll execute the
browsers (because of their JavaScript implementations), allowing users to use many programming languages (from java/c# to PHP, Erlang ...). , while webdriver compensates for the shortcomings of the Selenium 1, jumping out of the JavaScript sandbox, providing a fast, lightweight browser emulator. The reasons for merging are as follows:
Webdriver solves the shortcomings of Selenium (for
, but the XPath and Dom locators are also supported.
The third column containsValue. For exampleTypeCommand, this column may be the expected value of a text field.
Even for non-technical personnel, the test runner script is easy to read and write. When you open the example in Listing 1 in a browser, you will get a table like this:
First CommandTargetValue
Second commandTargetValue
Next, I will
descriptions?Yes [] no [] free []Does the test case include the boundary value, equivalence analysis, cause and error prediction, and other test case design methods? Are different design methods used for different parts of the requirement?Yes [] no [] free []There are at least three design methods for key requirement
Link: http://www-128.ibm.com/developerworks/cn/java/wa-selenium-ajax/
Christian Hellsten, IT expert, IBM
January 04, 2006
The acceptance test (also called a functional test) is used to test the functions of manual tasks, but these tasks are manually tested.It may take a long time, and human errors may easil
In this case test, the previous program is testedPackage Spittr.web;import Org.junit.test;import Org.springframework.test.web.servlet.mockmvc;import Org.springframework.test.web.servlet.request.mockmvcrequestbuilders;import Org.springframework.test.web.servlet.result.mockmvcresultmatchers;import Org.springframework.test.web.servlet.setup.mockmvcbuilders;public class Homecontrollertest {@Testpublic void Test
SeleniumThe Ultimate Automated test Environment Setup (II.)Selenium+eclipse+pythonThe previous example of the selenium+eclipse+junit+testng Automated test environment, on the basis of the previous article, the following example
Giithub Hosting
The architecture code for Automated tests is hosted on GitHub, and readers can download them themselvesHttps://github.com/626626cdllp/Test/tree/master/Test_framework Automated Testing Framework
In this automated testing framework.
stored in the Config directory is the test configuration related files, the configuration file can use the INI, XML, yml and other file types. For
be modified because junit 's Java file has its own format. Eighth stepEclipsethroughJunitExecutionSeleniumof theJavaExample-----8.1Right-click selenium_test,new->junit Test case to create a new Case2.java.Complete the following:-----8.2Modify the Case2.java code as follows:Package selenium_test;Import org.junit.*;Import org.openqa.selenium.*;Import Org.openqa.selenium.firefox.FirefoxDriver;public class Cas
of Selenium-webdriver, I found that the principle of webdriver is not inscrutable speculate. Here is an example of the firefox-webdriver implementation of Webdriver Ruby binding, which briefly describes how Webdriver works.When the test script starts Firefox, Selenium-webdriver will start the Firefox browser in the ne
One, what is UnitTest
The unittest we're going to use here is the Python unit test framework, and its website isHttps://docs.python.org/2/library/unittest.html, here we can get comprehensive information.
As we write more and more use cases, we need to consider the specification and organization of use case writing for later maintenance, and unittest is just such a tool. Here we use an
Directory1 Working with browsers1.1 Open a browser with Webdriver1.2 Maximize browser Close Browser1.3 Setting the browser window size1.4 Opening the test page1.5 new window for processing browser popup2 page element positioning3 How to manipulate page elements3.1 Webelement related methodsProcessing of 3.2 iframe3.3 Input box (text field or textarea)3.4 Drop-down selection box (select)3.5 Single option (Radio Button)3.6 Multiple options (checkbox)3.
expression for the page element.XPath, which is an XML Path Language (Xmlpathlanguage), is a language used to determine the location of a part of an XML document.Right-click on the page element, select "Inspect in Firepath", highlight the code in the Firepath panel, right-click the "Copy Xpath selector" in the tab header, and paste the XPath expression into something like Notepad.or right-click on the page element and select "Inspect in Firepath", where you can copy the XPath expression in the
1. In the actual testing process, the actual results are often compared with the expected results.2. If the actual result is inconsistent with the expected result, it is considered a bugSelenium is widely used in B/s architecture, how to verify the correctness of test results by selenium.
Case study: Take Baidu as an
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.